package com.nut.lmsc.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.nut.lmsc.entity.Category;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CategoryMapper extends BaseMapper<Category> {

    IPage<Category> listPage(Page page,
                             @Param("name") String name,
                             @Param("status") Integer status);

    @Select("select id,pid,name,img from biz_category where pid=#{pid} and status=1 and deleted=0 order by sort asc")
    List<Category> selectByPid(@Param("pid") Integer pid);

}